import logging, mailbox, os, rfc822, sys

from mailmigration import formats

SCRIPT_NAME = sys.argv[0].split(os.sep)[-1].split('.')[0].lower()
BLOCK_SIZE = 50
DEFAULT_SRC_FORMAT = 'mbox'
DEFAULT_DEST_FORMAT = 'maildir'
MAILBOX_FORMATS = {
    'mbox': mailbox.mbox,
    'maildir': mailbox.Maildir,
    'mailman': formats.MailmanGZ,
    'mh': mailbox.MH,
    'babyl': mailbox.Babyl,
    'mmdf': mailbox.MMDF,
}

LOG_FORMAT = '%(asctime)s: %(levelname)s %(message)s'
LOG_LEVELS = dict([(k, logging._levelNames[k]) for k in logging._levelNames \
                        if isinstance(k, basestring)])
VERBOSITY = logging.INFO

MESSAGE_FACTORIES = {
    #Use the MaildirMessage factory so we can skip a step and just set
    #the internal date directly
    ('mbox', 'maildir'): mailbox.MaildirMessage,
    #('mailman', 'mbox'): mailbox.mboxMessage,
}

